﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Runtime.Serialization;


namespace g42.Entities
{
  public class SampleEnt: BaseEnt
  {
    public virtual string Bezeichnung { get; set; }
  }

  /*
  /// <summary>An System.Collections.ObjectModel.ObservableCollection that raises individual item removal notifications on clear and prevents adding duplicates.</summary>
  /// <typeparam name="T"></typeparam>
  public class CommonDtoBaseCollection<T> : ObservableCollection<T>
  {
    public CommonDtoBaseCollection() { }
    public CommonDtoBaseCollection(IEnumerable<T> collection) : base(collection) { }
    public CommonDtoBaseCollection(List<T> list) : base(list) { }

    /// <summary>clears the items.</summary>
    protected override void ClearItems()
    {
      new List<T>(this).ForEach(t => Remove(t));
    }

    /// <summary>Inserts the item.</summary>
    /// <param name="index">The index.</param>
    /// <param name="item">The item.</param>
    protected override void InsertItem(int index, T item)
    {
      if (!this.Contains(item))
      {
        base.InsertItem(index, item);
      }
    }
  }

  /// <summary>Common base class which is the base class for all generated dtos which aren't a subtype of another dto.</summary>
  //[Serializable]
  public abstract partial class CommonDtoBase
  {
    /// <summary>Method called from the constructor</summary>
    partial void OnCreated();

    /// <summary>Initializes a new instance of the <see cref="CommonDtoBase"/> class.</summary>
    protected CommonDtoBase()
      : base()
    {
      OnCreated();
    }


    // __LLBLGENPRO_USER_CODE_REGION_START CustomDtoCode
    // __LLBLGENPRO_USER_CODE_REGION_END


  }

  /// <summary>Common base class which is the base class for all generated dtos which aren't a subtype of another dto.</summary>
  //[Serializable]
  public abstract partial class CommonDtoBase<TDto> : CommonDtoBase
  {
    /// <summary>Initializes a new instance of the <see cref="CommonDtoBase"/> class.</summary>
    protected CommonDtoBase()
      : base()
    {
    }


    // __LLBLGENPRO_USER_CODE_REGION_START CustomGenericDtoCode
    // __LLBLGENPRO_USER_CODE_REGION_END


  }
  //[Serializable]
  public partial class CategoryCollection : CommonDtoBaseCollection<Category>
  {
    public CategoryCollection() { }
    public CategoryCollection(IEnumerable<Category> collection) : base(collection ?? new List<Category>()) { }
    public CategoryCollection(List<Category> list) : base(list ?? new List<Category>()) { }
  }

  //[Serializable]
  public partial class Category : CommonDtoBase<Category>
  {
    public Category()
    {
      // this.Products = new ProductCollection();
    }

    /// <summary>Factory method to create a new instance of the type 'Category' (includes only required properties)</summary>
    /// <param name="categoryId">The initial value for the field 'CategoryId'</param>  
    /// <param name="categoryName">The initial value for the field 'CategoryName'</param>  
    public static Category Create(System.Int32 categoryId, System.String categoryName)
    {
      var entity = new Category();
      entity.CategoryId = categoryId;
      entity.CategoryName = categoryName;
      return entity;
    }

    /// <summary>Factory method to create a new instance of the type 'Category' (includes optional properties)</summary>
    /// <param name="categoryId">The initial value for the field 'CategoryId'</param>  
    /// <param name="categoryName">The initial value for the field 'CategoryName'</param>  
    /// <param name="description">The initial value for the field 'Description'</param>  
    /// <param name="picture">The initial value for the field 'Picture'</param>  
    public static Category Create(System.Int32 categoryId, System.String categoryName, System.String description, System.Byte[] picture)
    {
      var entity = new Category();
      entity.CategoryId = categoryId;
      entity.CategoryName = categoryName;
      entity.Description = description;
      entity.Picture = picture;
      return entity;
    }

    #region Class Property Declarations

    /// <summary>Gets or sets the CategoryId field. </summary>
    public virtual System.Int32 CategoryId { get; set; }

    /// <summary>Gets or sets the CategoryName field. </summary>
    public virtual System.String CategoryName { get; set; }

    /// <summary>Gets or sets the Description field. </summary>
    public virtual System.String Description { get; set; }

    /// <summary>Gets or sets the Picture field. </summary>
    public virtual System.Byte[] Picture { get; set; }

    /// <summary>Represents the navigator which is mapped onto the association 'Product.Category - Category.Products (m:1)'</summary>
    // public virtual ProductCollection Products { get; set; }

    #endregion



    

  }
   */ 
}
